<template>
  <div class="search-com">
    <el-form :inline="true"  class="demo-form-inline">
      <el-form-item label="">
    <el-select size="mini" v-model="region" placeholder="请选择科室">
      <el-option label="内科-肾内科" value="内科-肾内科"></el-option>
      <el-option label="外科-神经科" value="外科-神经科"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item label="">
    <el-input size="mini" v-model="user" placeholder="请输入医生姓名"></el-input>
  </el-form-item>
  <el-form-item >
    <el-button size="mini" type="primary" @click="onSubmit">搜索</el-button>
  </el-form-item>
   <el-form-item class="left">
      <el-button size="mini"  type="primary" plain @click="deleallfn">全部删除</el-button>
      <el-button size="mini"  type="primary" @click="addclickFn">新增医生信息</el-button>
    </el-form-item>
</el-form>
  </div>
</template>

<script>
import {searchFn} from '../../../api/home1.js'
import eventBus from '../../../utils/busEvent'
export default {
data() {
      return {
          user:'',
          region: '',
      }
    },
    methods: {
      //新增信息
      addclickFn(){
        this.$emit('addopenDialog')
      },
      //全部删除
      deleallfn(){
        eventBus.$emit('delalltarnder')
      },
      onSubmit() {
        //2 子到父传递
        // console.log(this.user);
         this.$emit('serachtran',this.user)
        // console.log('submit!'),
        // searchFn({user:this.formInline.user,region:this.formInline.region}).then(res=>{
        //   console.log(res);
        //   
        // })
      }
    }
}
</script>

<style lang="less" scoped>
.search-com {
  text-align: left;
  height: 50px;
  /deep/.left{
    margin-left: 100px;
  }
  // background-color: rgb(194, 112, 112);
//   /deep/.el-input__inner{
//     height: 30px;
// }
}

// .el-button{
//   height: 30px;
//   margin-top: 5px;
//   line-height: 6px;
// }

</style>